home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / exec / semaphores.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-20  |  1.4 KB  |  71 lines

  1. #ifndef    EXEC_SEMAPHORES_H
  2. #define    EXEC_SEMAPHORES_H
  3. /*
  4. **    $VER: semaphores.h 39.1 (7.2.1992)
  5. **    Includes Release 44.1
  6. **
  7. **    Definitions for locking functions.
  8. **
  9. **    (C) Copyright 1986-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include <exec/nodes.h>
  15. #endif /* EXEC_NODES_H */
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif /* EXEC_LISTS_H */
  20.  
  21. #ifndef EXEC_PORTS_H
  22. #include <exec/ports.h>
  23. #endif /* EXEC_PORTS_H */
  24.  
  25. #ifndef EXEC_TASKS_H
  26. #include <exec/tasks.h>
  27. #endif /* EXEC_TASKS_H */
  28.  
  29.  
  30. /****** SignalSemaphore *********************************************/
  31.  
  32. /* Private structure used by ObtainSemaphore() */
  33. struct SemaphoreRequest
  34. {
  35.     struct MinNode    sr_Link;
  36.     struct Task    *sr_Waiter;
  37. };
  38.  
  39. /* Signal Semaphore data structure */
  40. struct SignalSemaphore
  41. {
  42.     struct Node        ss_Link;
  43.     WORD            ss_NestCount;
  44.     struct MinList        ss_WaitQueue;
  45.     struct SemaphoreRequest    ss_MultipleLink;
  46.     struct Task        *ss_Owner;
  47.     WORD            ss_QueueCount;
  48. };
  49.  
  50. /****** Semaphore procure message (for use in V39 Procure/Vacate) ****/
  51. struct SemaphoreMessage
  52. {
  53.     struct Message        ssm_Message;
  54.     struct SignalSemaphore    *ssm_Semaphore;
  55. };
  56.  
  57. #define    SM_SHARED    (1L)
  58. #define    SM_EXCLUSIVE    (0L)
  59.  
  60. /****** Semaphore (Old Procure/Vacate type, not reliable) ***********/
  61.  
  62. struct Semaphore    /* Do not use these semaphores! */
  63. {
  64.     struct MsgPort    sm_MsgPort;
  65.     WORD        sm_Bids;
  66. };
  67.  
  68. #define sm_LockMsg mp_SigTask
  69.  
  70. #endif    /* EXEC_SEMAPHORES_H */
  71.